]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
switcherPopup: Fix switch-group mouse click regression
authorHåkon Hægland <hakon.hagland@gmail.com>
Tue, 11 Nov 2025 18:46:32 +0000 (19:46 +0100)
committerHåkon Hægland <hakon.hagland@gmail.com>
Tue, 11 Nov 2025 18:46:32 +0000 (19:46 +0100)
The LongPressGesture 'may-recognize' callback in commit 314137c8c was
checking if clicks were inside '_switcherList', but thumbnails shown by
switch-group are siblings of _switcherList, not children.

This caused the gesture to incorrectly identify thumbnail clicks as
'outside' clicks, closing the popup before the click could complete.

Fix by adding a _isActorOutside() helper method that subclasses can
override to check additional containers. AppSwitcherPopup now properly
checks both _switcherList and _thumbnails.

Tested on Ubuntu 25.10 with GNOME Shell 49.0. Confirmed:
- switch-group mouse clicks now work
- switch-applications and switch-windows unaffected
- clicking outside the popup still closes it correctly
- no regressions introduced

Fixes: 314137c8c9 ("switcherPopup: Move to a ClutterGesture for closing the popup")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8812
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3959>

js/ui/altTab.js
js/ui/switcherPopup.js

index 2722fadf0a1e776c49bb09e509e8fa34b8d52920..91020e6d3fbc03c97ad871c54fb92ee994ee15db 100644 (file)
@@ -294,6 +294,11 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
         super._onDestroy();
     }
 
+    _isActorOutside(actor) {
+        return super._isActorOutside(actor) &&
+               !this._thumbnails?.contains(actor);
+    }
+
     /**
      * _select:
      *
index e9badf6ae3d96eb37459aa4e2df34010a5f2852d..c1515be45e47d782b2db87ef13229065242bb0f8 100644 (file)
@@ -76,7 +76,7 @@ export const SwitcherPopup = GObject.registerClass({
             const actorAtCoords =
                 global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, coords.x, coords.y);
 
-            return !this._switcherList?.contains(actorAtCoords);
+            return this._isActorOutside(actorAtCoords);
         });
         longPressGesture.connect('recognize', () => {
             // User clicked outside
@@ -309,6 +309,10 @@ export const SwitcherPopup = GObject.registerClass({
         return GLib.SOURCE_REMOVE;
     }
 
+    _isActorOutside(actor) {
+        return !this._switcherList?.contains(actor);
+    }
+
     _resetNoModsTimeout() {
         if (this._noModsTimeoutId !== 0)
             GLib.source_remove(this._noModsTimeoutId);